
#逆置整数
# num = input()
#
# # 将字符串逆序并转换为整数（自动去除可能的前导零）
# reversed_num = int(num[::-1])
#
# # 输出逆序后的结果
# print(reversed_num)

#计算a和A在字符串中出现几次

# # 获取用户输入的字符串
# s = input()
# # 初始化计数器
# count = 0
# # 遍历字符串中的每个字符
# for char in s:
#     # 检查字符是否为'a'或'A'
#     if char == 'a' or char == 'A':
#         count += 1
# # 输出结果
# print(count)


#输入若干个用逗号间隔的单词，调整至每个单词仅首字母大写，最后输出所有单词并用空格间隔。
# words_input = input()
#
# # 按逗号分割成单词列表
# words_list = words_input.split(',')
#
# # 处理每个单词：首字母大写，其余字母小写
# capitalized_words = [word.capitalize() for word in words_list]
#
# # 用空格连接所有单词并输出
# print(' '.join(capitalized_words))



# scores = [78, 92, 84, 65, 97, 88, 75, 91]
#
# # 找到最低分
# min_score = min(scores)
#
# # 移除第一个出现的最低分
# scores.remove(min_score)
#
# # 计算剩余得分的平均分（保留1位小数）
# average = sum(scores) / len(scores)
#
# # 找出所有高于平均分的得分
# above_average = [score for score in scores if score > average]
#
# # 按从高到低排序
# above_average.sort(reverse=True)
#
# # 输出结果
# print(above_average)
#


# def generate_recursive_strings(n):
#     strings = []
#     prev = "A"
#     strings.append(prev)
#
#     for i in range(2, n + 1):
#         current_char = chr(ord('A') + i - 1)
#         current = prev + current_char + prev
#         strings.append(current)
#         prev = current
#
#     return strings
#
#
# n = int(input())
#
# result = generate_recursive_strings(n)
#
# for i, s in enumerate(result, 1):
#     print(f"{i}: {s}")



# def merge_intervals(intervals):
#     # 如果区间列表为空，直接返回空列表
#     if not intervals:
#         return []
#
#     # 按区间的起始值进行排序
#     sorted_intervals = sorted(intervals, key=lambda x: x[0])
#
#     # 初始化结果列表，放入第一个区间
#     merged = [sorted_intervals[0]]
#
#     # 遍历剩余区间并合并
#     for current in sorted_intervals[1:]:
#         # 获取结果列表中最后一个区间
#         last = merged[-1]
#
#         # 如果当前区间与最后一个区间重叠，合并它们
#         if current[0] <= last[1]:
#             merged[-1] = [last[0], max(last[1], current[1])]
#         else:
#             # 不重叠则直接添加到结果列表
#             merged.append(current)
#
#     return merged
#
#
# # 测试示例
# intervals = [[1, 3], [2, 6], [8, 16], [15, 18]]
# merged_result = merge_intervals(intervals)
# print(merged_result)  # 输出: [[1, 6], [8, 18]]
#

#
#
# def collatz_sequence(n):
#     # 确保输入是正整数
#     if not isinstance(n, int) or n <= 0:
#         raise ValueError("输入必须是正整数")
#
#     sequence = []
#     current = n
#
#     # 生成序列直到 current 变为 1
#     while current != 1:
#         if current % 2 == 0:
#             current = current // 2
#         else:
#             current = 3 * current + 1
#         sequence.append(current)
#
#     return sequence
#
#
# # 获取用户输入并生成序列
# try:
#     num = int(input("请输入一个正整数: "))
#     result = collatz_sequence(num)
#     # 按要求格式输出序列
#     print(",".join(map(str, result)))
# except ValueError as e:
#     print(e)

#
# str = input()
#
# count = 0
#
# for ch in str:
#     if ch.isdigit():
#         count= int(ch)+count
# print(count)


# a = [1, 2, 3]; b = a; b[0] = 4
#
# print(a)
#



# s = "Python"; print(s[1:4])
